
-- --------------------------------------------------
-- Entity Designer DDL Script for SQL Server 2005, 2008, and Azure
-- --------------------------------------------------
-- Date Created: 04/26/2012 10:40:07
-- Generated from EDMX file: C:\Users\Administrator\Documents\Visual Studio 2010\Projects\视频设备\视频设备\Model1.edmx
-- --------------------------------------------------

SET QUOTED_IDENTIFIER OFF;
GO
USE [equipment];
GO
IF SCHEMA_ID(N'dbo') IS NULL EXECUTE(N'CREATE SCHEMA [dbo]');
GO

-- --------------------------------------------------
-- Dropping existing FOREIGN KEY constraints
-- --------------------------------------------------


-- --------------------------------------------------
-- Dropping existing tables
-- --------------------------------------------------

IF OBJECT_ID(N'[dbo].[设备主人集]', 'U') IS NOT NULL
    DROP TABLE [dbo].[设备主人集];
GO
IF OBJECT_ID(N'[dbo].[观众账号集]', 'U') IS NOT NULL
    DROP TABLE [dbo].[观众账号集];
GO

-- --------------------------------------------------
-- Creating all tables
-- --------------------------------------------------

-- Creating table '设备主人集'
CREATE TABLE [dbo].[设备主人集] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [url] nvarchar(max)  NULL,
    [用户名] nvarchar(max)  NULL,
    [密码] nvarchar(max)  NULL,
    [姓名] nvarchar(max)  NULL,
    [备注] nvarchar(max)  NULL,
    [序列号] nvarchar(max)  NOT NULL,
    [问题] nvarchar(max)  NULL,
    [回答] nvarchar(max)  NULL
);
GO

-- Creating table '观众账号集'
CREATE TABLE [dbo].[观众账号集] (
    [用户ID] int IDENTITY(1,1) NOT NULL,
    [用户名] nvarchar(max)  NULL,
    [密码] nvarchar(max)  NULL,
    [姓名] nvarchar(max)  NULL,
    [备注] nvarchar(max)  NULL,
    [权限] nvarchar(max)  NOT NULL,
    [问题] nvarchar(max)  NULL,
    [答案] nvarchar(max)  NULL
);
GO

-- --------------------------------------------------
-- Creating all PRIMARY KEY constraints
-- --------------------------------------------------

-- Creating primary key on [ID] in table '设备主人集'
ALTER TABLE [dbo].[设备主人集]
ADD CONSTRAINT [PK_设备主人集]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [用户ID] in table '观众账号集'
ALTER TABLE [dbo].[观众账号集]
ADD CONSTRAINT [PK_观众账号集]
    PRIMARY KEY CLUSTERED ([用户ID] ASC);
GO

-- --------------------------------------------------
-- Creating all FOREIGN KEY constraints
-- --------------------------------------------------

-- --------------------------------------------------
-- Script has ended
-- --------------------------------------------------